<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example - example-example70-debug</title>
  

  <script src="../../../angular.js"></script>
  

  
</head>
<body ng-app="submitExample">
   <script>
   angular.module('submitExample', [])
     .controller('ExampleController', ['$scope', function($scope) {
       $scope.list = [];
       $scope.text = 'hello';
       $scope.submit = function() {
         if ($scope.text) {
           $scope.list.push(this.text);
           $scope.text = '';
         }
       };
     }]);
 </script>
 <form ng-submit="submit()" ng-controller="ExampleController">
   Enter text and hit enter:
   <input type="text" ng-model="text" name="text" />
   <input type="submit" id="submit" value="Submit" />
   <pre>list={{list}}</pre>
 </form>
</body>
</html>